package com.xbs.dao.enterprise;


import java.sql.ResultSet;
import java.sql.SQLException;

import com.sun.rowset.internal.Row;
import com.xbs.dao.conn.BaseDao;
import com.xbs.dao.conn.ParamSet;
import com.xbs.dao.conn.RowDatas;
import com.xbs.entity.EnterpriseEntity;

public class EpLoginDao extends BaseDao{
	/**
	 * 验证企业密码是否正确
	 */
	public boolean isEp(String account,String pwd){
		String sql="select enterprise_id from tb_enterprise where enterprise_id=? and enterprise_password=?";
		RowDatas<EnterpriseEntity> rd=new RowDatas<EnterpriseEntity>() {

			@Override
			public EnterpriseEntity getRowData(ResultSet rs) throws SQLException {
				EnterpriseEntity e=new EnterpriseEntity();
				e.setEnterprise_id(rs.getString("enterprise_id"));
				return e;
			}
		};
		
		EnterpriseEntity ee=query(sql,new ParamSet(account,pwd), rd);
		
		if(ee==null){
			return false;
		}
		return true;
	}
}
